{{#extends @community.html}}

{{:title}}
    {{community.title}}
{{/:title}}

{{:init}}
    {{!connect "master.css" media="all" charset="utf-8"}}
    {{!connect "content.css" media="all" charset="utf-8"}}
    {{!connect "screen/community-head.css" media="screen" charset="utf-8"}}
    {{!connect "screen/portal.css" media="screen" charset="utf-8"}}
    {{!connect "screen/footer.css" media="screen" charset="utf-8"}}
    {{!connect "screen/layout-standard.css" media="screen" charset="utf-8"}}
    {{!connect "screen/content-cindex.css" media="screen" charset="utf-8"}}
    {{!connect "screen/widgets-default.css" media="screen" charset="utf-8"}}
    {{!connect "tinymce/tiny_mce_src.js"}}
	{{!connect "tiny_mce_start.js"}}
	{{!connect "screen/quest/quest.css"}}
	{{!connect "screen/quest/votes.css"}}

    {{!connect "screen/content-posts.css" media="screen" charset="utf-8"}}
	{{!connect "screen/widgets-default.css" media="screen" charset="utf-8"}}

    {{!connect "jquery.js"}}
    {{!connect "cpaint2.inc.js"}}
    {{!connect "misc.js"}}

	{{!connect "feed.js"}}

    {{!connect "screen/content-quest.css" media="screen" charset="utf-8"}}

    {{!connect "jplugins/jtemplates.js"}}
    <!-- {{!connect "jplugins/interface.js"}} -->
    {{!connect "jplugins/interface/idrag.js"}}
    {{!connect "jplugins/interface/idrop.js"}}
    {{!connect "jplugins/interface/iutil.js"}}
    {{!connect "jplugins/interface/isortables.js"}}

    {{!connect "jplugins/custom.js"}}
    {{!connect "quest/doc.js"}}
    {{!connect "quest/show.js"}}

    <!-- RSS записей сообщества -->
    {{@:connect_rss url=@:rss_url title=@:rss_title}}
    {{:rss_title}}Все записи сообщества{{/:rss_title}}
    {{:rss_url}}{{/}}{{community.url}}/feed.xml{{/:rss_url}}

    <!-- RSS комментов сообщества -->
    {{@:connect_rss url=@:rss_comments_url title="Все комментарии сообщества"}}
    {{:rss_comments_url}}{{/}}{{community.url}}/comments.xml{{/:rss_comments_url}}

{{/:init}}


{{:settings_button}}
{{?livepage}}
     <li class="moderator-" id="mod-interface"><a>Включить режим модератора</a></li>
        <!-- HACK : 2008-02-11 : lucky #375 -->
        <!-- подключаем TinyMCE тут для виджетов,
        т.к. вижет не может сделать это при помощи ajax -->
        {{!connect "tinymce/tiny_mce_src.js"}}
        {{!connect "tiny_mce_start.js"}} <!-- Constructs TinyMCE default config and tinyMCE.init(config) -->
        <!-- подключаем скрипт для виджета CmsMenu -->
        {{!connect "widgets/cms_menu.js"}}
        <!-- подключаем скрипт для виджета HotDocument -->
        {{!connect "widgets/hot_doc.js"}}
{{/?}}
{{/:settings_button}}


{{:body}}

    {{@:community_head}}

    {{?is_new!=1}}
{{@html/widgets/widget.html:background}}
<div class="popup-widgets" id="voting_form" style="display: none;"></div>
	{{/?}}

    <!-- content zone -->
    <!-- Вот тут класс widgetcolumn это колонка в которой будет drag, а класс widget это итем которые таскается -->
    <div class="content-cindex layout-standard">
        <div class="layout-c-left widgetcolumn wg-droppable" id="column0">
            {{@html/widgets/widget.html:addwidget_button}}
            {{column0}}
        </div>
        <div class="layout-c-right widgetcolumn wg-droppable" id="column2">
            {{column2}}
        </div>
        <div class="layout-c-main">
            {{@:realbody}}
        </div>
    </div>

    {{@html/common/footer.html}}
{{/:body}}

{{:realbody}}
		<div class="quest-page-top"><div></div></div>
		<div class="quest-page content-posts">
			{{@:main}}
			{{@:tabs_panel}}
            <div id="itemslist" class="list-">
    			{{!for search_items do=@:search_item}}
    		</div>
		</div>
		<div class="quest-page-bottom"><div><div></div></div></div>
{{/:realbody}}

{{:main}}
<!-- ========================= Установки для работы js ============== -->
<!-- для imageswitcher.js -->
{{@html/config/imageswitcher.html}}

<a href="{{ajax_url}}" id="feed_url"></a>
<a href="{{items_remaining}}" id="items_remaining"></a>
<!-- ========================= Установки для работы js ============== -->


			<div class="quest-h1-type-1">
				{{quest.title}}
			</div>
			<div class="quest-description content">
				{{?quest.is_finished}}
					<p>Квест завершён:</p>
					<div><i>
						{{quest.post_anonce | safe}}
					</i></div>
					<a href="#" onClick="return questToggleDescription(this)">Условия конкурса</a><span class="dots"> ...</span>
					<div class="quest_descript dn">{{quest.descript | safe}}</div>
				{{?:}}
					{{quest.descript | safe}}
				{{/?}}
				<br/>
				{{?edit_link}}<br/><a href="{{edit_link}}">Редактирование</a>{{/?}}
				{{?admin_link}}<br/><a href="{{admin_link}}" onClick="return popup_window('{{admin_link}}', '', {'height':400, 'width':600})">Модерация</a>{{/?}}
			</div>
{{/:main}}

{{:tabs_panel}}
<div class="quest-nomination-list">
	{{?votings.2}} <!-- когда больше одной номинации -->
		{{!for votings do=@:voting_tab}}
	{{?:}} <!-- когда одна номинация показываем один таб (fix #724) -->
		<div class="quest-nomination-active"><div>{{votings.1.name}}</div></div>
	{{/?}}

    {{:voting_tab *cur}}
    <div class="quest-nomination-active"><div>{{*name}}</div></div>
    {{/:voting_tab}}

    {{:voting_tab}}
    <div><a href="{{*url}}">{{*name}}</a></div>
    {{/:voting_tab}}
	{{?votings_hide}}<div>
		<div class="quest-input-down" style="display: none;">
		{{!for votings_hide do=@:voting_tab_h}}
		    {{:voting_tab_h}}
		    <a href="{{*url}}">{{*name}}</a>
		    {{/:voting_tab_h}}
		</div>
		<a href="#" onclick="return showHidenTabs();" class="quest-more"><img src="{{images}}quest/quest_more.gif" alt="">Еще</a>
	</div>{{/?}}
</div>
<div class="quest-clear"></div>
<div class="quest-sortirovka">
	<div class="quest-finalist-but"><div><a href="{{finish_url}}">{{?is_finish}}Все{{?:}}Финалисты{{/?}}</a>&nbsp;({{final_count}})</div></div>
	<div class="quest-sortirovka-element">
		{{?sort_by==0}}<span>По популярности</span><a href="{{sort_url}}">По дате</a>{{?:}}
		<a href="{{sort_url}}">По популярности</a><span>По дате</span>{{/?}}
	</div>
	<div class="quest-clear"></div>
</div>
{{/:tabs_panel}}

{{:search_item}}
<div class="item- js-post" id="i{{*post.oid}}">
	{{?*platonicaid_author}}
		{{@:author author=*platonicaid_author}}
	{{?:}}
		{{@:author author=*author}}
	{{/?}}
	{{!doctype @html/doctypes/feed/__DOCTYPE__.html *post.type}}
	{{@:quest_actions}}
	{{?*tags}}
	<ul class="tags-">
		<li class="hdr-">Тематика записи:</li>
		{{!for *tags do=@:tag}}
		{{:tag *is_current}}<li>{{*title}}{{?!For.last}},{{/?}}</li>{{/:tag}}
		{{:tag}}<li><a href="{{feed_url}}?tag={{*title|escape type='url'}}" title="Выбрать все записи с меткой &laquo;{{*title}}&raquo;">{{*title}}</a>{{?!For.last}},{{/?}}</li>{{/:tag}}
	</ul>
	{{/?}}

	<!-- блок комментов (добавьте во внешний тег class="js-post" и id="i{{post_oid}}") -->
	{{@html/comments/comments.html:main item=*}}
</div>
{{/:search_item}}

{{:author}}
<div class="author-">
	{{?author.oid}}
		<!-- registered -->
	<a href="{{?!author.url}}{{/}}{{community.url}}/members/{{author.oid}}{{?:}}{{author.url}}{{/?}}">
		{{?!author.avatar_url}}
		<img src="{{?author.avatar}}{{/}}{{!link_to author.avatar 'imagestorage' 'sm1'}}{{?:}}{{images}}avatar-48x48.png{{/?}}" class="avatar-" />{{?:}}<img src="{{author.avatar_url}}" class="avatar-" />{{/?}}
		</a>
	<a href="{{?!author.url}}{{/}}{{community.url}}/members/{{author.oid}}{{?:}}{{author.url}}{{/?}}" class="name-">{{author.name}}</a>
	{{?author.status}}<div class="status-">{{author.status}}</div>{{/?}}
	{{?:}}
		<!-- anonymous -->
		<img src="{{images}}avatar-48x48.png" class="avatar-" />
		<div class="status-">Платонимус</div>
	{{/?}}
</div>
{{/:author}}

{{:quest_actions}}
<div id="vote_panel_{{*post.oid}}_{{quest.id}}" >
	{{@:action_panel_content q=quest doc=*post}}
</div>
<div class="quest-clear"></div>
<div id="vote_container_{{*post.oid}}_{{quest.id}}" style="display: none;" class="votes-window votes-window2">{{*action_url}}</div>
{{/:quest_actions}}

{{:action_panel_content}}
	{{?*btns.f}} <img src="{{images}}quest/votes-ico-f.gif" alt="final" title="В финале" class="que1t-votes-button" /> {{/?}}
	{{?*btns.v}} <img onclick="return showQuestAction({{q.id}},{{doc.oid}},this,0)" src="{{images}}quest/votes-ico-v.gif" alt="v" class="que1t-votes-button{{?is_active}} votes-buttons-active{{/?}}" title="Показать результаты" id="quest_btn_{{doc.oid}}_{{q.id}}" />
	{{?:*btns.n}} <img onclick="return showQuestAction({{q.id}},{{doc.oid}},this,0)" src="{{images}}quest/votes-ico-n.gif" alt="+" class="que1t-votes-button{{?is_active}} votes-buttons-active{{/?}}" title="Показать результаты" id="quest_btn_{{doc.oid}}_{{q.id}}" /> 
	{{/?}}
	<div class="votes-ball votes-ball1" id="cur_balls_btn_{{doc.oid}}_{{q.id}}" title="Количество проголосовавших" >{{*voters}}</div>

<!-- {{?state!='f'}}<a style="float: left;" href="#" onclick="return documentInFinal({{quest}},{{doc}})">Добавить в финал</a>{{/?}} -->
{{/:action_panel_content}}
